<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <title>Rust Quiz</title>

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-82804814-3"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-82804814-3');
    </script>

    <meta property="og:image" content="https://avatars2.githubusercontent.com/u/1940490?s=400" />
    <meta property="og:site_name" content="Rust Quiz" />
    <meta property="og:title" content="Rust Quiz" />
    <meta property="og:description" content="What is the output of this Rust program?" />
    <meta name="twitter:image:src" content="https://avatars2.githubusercontent.com/u/1940490?s=400" />
    <meta name="twitter:site" content="@davidtolnay" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Rust Quiz" />
    <meta name="twitter:description" content="What is the output of this Rust program?" />

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
    <link rel="stylesheet" href="/rust-quiz/quiz.css">
  </head>

  <body class="bg-light">
    <div class="page">
      <div class="container">
        <div class="pt-5">
          <h2>Rust Quiz<span id="question-number" class="ml-4 notbold d-none">#<span id="current">1</span></span></h2>
          <p class="lead">What is the output of this Rust program?</p>
        </div>

        <pre id="accordion" class="my-4 show"><code id="code" class="rust">
          <noscript>// JavaScript is required (sorry)</noscript>
        </code></pre>

        <form id="form">
          <div class="mt-4 mb-2">
            <div class="custom-control custom-radio">
              <input id="radio-undefined" name="paymentMethod" type="radio" class="custom-control-input">
              <label class="custom-control-label" for="radio-undefined">The program exhibits undefined behavior</label>
            </div>
            <div class="custom-control custom-radio">
              <input id="radio-error" name="paymentMethod" type="radio" class="custom-control-input">
              <label class="custom-control-label" for="radio-error">The program does not compile</label>
            </div>
            <div class="custom-control custom-radio">
              <input id="radio-output" name="paymentMethod" type="radio" class="custom-control-input">
              <label class="custom-control-label" for="radio-output">
                <span class="mb-3 mr-2">The program is guaranteed to output:</span>
              </label>
              <input type="tel" class="form-control mb-1" id="text-output" autocomplete="off">
              <a id="button-playground" href="#" target="_blank" class="btn btn-sm btn-outline-secondary d-none" role="button">
                Playground
              </a>
            </div>
          </div>

          <div id="explanation-alert" class="d-none">
            <div class="alert alert-success pt-3 pb-0">
              <p id="explanation-correct" class="d-none"><strong>Correct!</strong></p>

              <div id="explanation-content"></div>
            </div>

            <div id="button-next">
              <button class="btn btn-primary" type="button">Next question</button>
            </div>
          </div>

          <div id="nav">
            <button id="button-submit" class="btn btn-primary mr-2" type="submit">
              Answer
            </button><button id="button-hint" class="btn btn-sm btn-outline-secondary mr-2" type="button">
              Hint
            </button><button id="button-skip" class="btn btn-sm btn-outline-secondary mr-2" type="button">
              Skip
            </button><button id="button-reveal" class="btn btn-sm btn-outline-secondary mr-2" type="button">
              Reveal<span id="sad"> 😞</span>
            </button><span id="incorrect" class="ml-4 text-danger text-nowrap d-none">
              Incorrect! Try again.
            </span>
          </div>

          <div id="hint-alert" class="mt-3 pt-3 pb-0 alert alert-primary d-none">
            <p><strong>Hint</strong></p>

            <div id="hint-content"></div>
          </div>
        </form>

        <div id="footer" class="font-weight-light font-italic text-muted mt-5">
          <p>You have answered
            <span id="answered">0</span>
          of
            <span id="total">0</span>
          questions correctly.</p>
          <p id="contribute" class="d-none">
            <a href="https://github.com/dtolnay/rust-quiz" target="_blank">Contribute more questions!</a>
          </p>
        </div>
      </div>

      <div id="reset" class="reset d-none">
        <a href="javascript:reset();" class="reset-link"></a>
      </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/rust.min.js"></script>
    <script src="/rust-quiz/questions.js"></script>
    <script src="/rust-quiz/quiz.js"></script>
  </body>
</html>
